//
//  GridController.h
//  FirstGridApp
//
//  Created by Andrew Spina on 4/10/10.
//  Copyright 2010 STScI. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>

#import "Point2d.h"
#import "GridCellUIView.h"
#import "Token.h"

@interface GridController : UIViewController <UIScrollViewDelegate> {
	UIScrollView *gridScrollView;
	UIView *masterView;
	NSMutableArray *map;
	NSMutableArray *cells;
	Point2d *activeTokenLocation;
	NSMutableDictionary *cellUIToPointDict;
	Token *nullToken;
	NSMutableArray *tokenArray;
}

@property (nonatomic, retain) IBOutlet UIScrollView *gridScrollView;
@property (nonatomic, retain) UIView *masterView;
@property (nonatomic, retain) NSMutableArray *map;
@property (nonatomic, retain) NSMutableArray *cells;
@property (nonatomic, retain) Point2d *activeTokenLocation;
@property (nonatomic, retain) NSMutableDictionary *cellUIToPointDict;
@property (nonatomic, retain) Token *nullToken;
@property (nonatomic, retain) NSMutableArray *tokenArray;

- (void) cellTapped: (GridCellUIView*) cell;
- (Token*) tokenAtPoint: (Point2d *) point;
- (bool) isTokenAtPoint: (Point2d *) point;
- (void) tapCell: (Point2d*) point;
- (GridCellUIView*) cellForPoint: (Point2d *) point;

@end
